package com.front.teacher.teacherapp.view.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Administrator on 2016/8/12.
 */
public class TabActivityAdapter extends FragmentPagerAdapter {
    private List<Fragment> fragments ;
    private List<String> tabsList = new ArrayList<>();
    public TabActivityAdapter(FragmentManager fm,List<Fragment> fragments) {
        super(fm);
        this.fragments = fragments;
        tabsList.add("进行中");
        tabsList.add("未开始");
        tabsList.add("已结束");
    }

    @Override
    public Fragment getItem(int position) {
        return fragments.get(position);
    }

    @Override
    public int getCount() {
        return fragments.size();
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return tabsList.get(position);
    }
}
